﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Small.Html.Options
{
   public class JqBase
    {
        private string othertAtributes;

        public string OthertAtributes
        {
            get { return othertAtributes; }
            set { othertAtributes = value; }
        }
        public string IsStringNull(string name, string value)
        {
            if (!string.IsNullOrEmpty(name))
            {
                return string.Format("{0}:'{1}'", name, value);
            }

            return null;
        }

        public string IsInteger(string name, Int32 value)
        {
            if (!string.IsNullOrEmpty(name))
            {
                return string.Format("{0}:{1}", name, value);
            }

            return null;

        }

        public string IsDecimal(string name, decimal value)
        {
            if (!string.IsNullOrEmpty(name))
            {
                return string.Format("{0}:{1}", name, value);
            }

            return null;

        }

        public virtual String GenerateString() 
        {
            return null;
        }
        public string IsBool(string name, bool value)
        {
            if (value)
            {
                return string.Format("{0}:true", name);
            }
            else
            {
                return string.Format("{0}:false", name);
            }


        }

        public string Event(string name, string value) 
        {
            if (!string.IsNullOrEmpty(name))
            {
                return string.Format("{0}:{1}", name, value);
            }

            return null;
        }
      
    }
}
